package com.hoku.account.dao;

import com.google.common.collect.Maps;
import com.hoku.account.model.Account;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @author ZHUFEIFEI
 */
@Repository
public class AccountDaoImpl implements IAccountDao {

    private Map<String, Account> memory = Maps.newConcurrentMap();

    @Override
    public Account findByName(String accountName) {
        return memory.get(accountName);
    }

    @Override
    public void save(Account account) {
        memory.put(account.getName(), account);
    }
}
